"""LangGraph single-node graph template.

Returns a predefined response. Replace logic and configuration as needed.
"""
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent

from agent.env_utils import DASHSCOPE_API_KEY, QWEN_BASE_URL
from agent.my_llm import llm


# 本地私有化部署的大模型
# llm = ChatOpenAI(
#     model='qwen-plus',
#     temperature=0.8,
#     api_key=DASHSCOPE_API_KEY,
#     base_url=QWEN_BASE_URL,
#     extra_body={'chat_template_kwargs': {'enable_thinking': False}},
# )


def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"{city}今天下雨了!"


# Define the graph
graph = create_react_agent(
    llm,
    tools=[get_weather],
    prompt="你是一个私人助手"
)
